package com.chennan.excelpoi.service.impl;

import com.chennan.excelpoi.model.CardMoadl;
import com.chennan.excelpoi.service.CardImportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author chennan
 * @create 2022-09
 */
@Service
public class CardImportServiceImpl implements CardImportService {

    private static Integer sum = 0;

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public void saveMap(List<Object> cachedDataList) {
        sum+=cachedDataList.size();
        for (Object obj : cachedDataList) {
            CardMoadl obj1 = (CardMoadl) obj;
            System.out.println("保存了数据"+obj1.getData().get(3).getPropertyName()+obj1.getData().get(3).getPropertyTitle()+obj1.getData().get(3).getValue());

        }
        System.out.println("保存了数据"+sum);
    }

    @Override
    public void save(List<Object> cachedDataList) {
        System.out.println("保存了数据"+cachedDataList.size());

    }
}
